<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .inputbox input{
            height: 40px;
            width: 100%;
            border: 1px solid #ccc;
            padding-left:20px;
            text-align: center;
            outline: none;
        }
        .swiper{
            height: 200px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        .list .goods{
            height: 100px;
            border: 1px solid #ccc;
            margin: 10px;
        }
        .tabbar{
            display: flex;
            width: 100%;
            position: fixed;
            bottom: 0;
            justify-content: space-around;
            align-items: center;
            padding: 15px;
            border-top: 1px solid #ccc;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="home">
            <!-- 输入框 -->
        <aa></aa>
        <!-- 轮播图 -->
        <bb></bb>
        <!-- 推荐列表 -->
        <cc></cc>
        <!-- 导航栏 -->
        <ee></ee>
        </div>
        
    </div>
</body>
<script src="./vue-2.5.21.js"></script>
<script>
    // 对象形式的组件，template的值是组件的模板（标签）

    // 定义组件
    // 输入框组件
    var inputBox={
        template:`<div class="inputbox">
                        <input type="text" placeholder="输入商品名称">
                  </div>`
    }
    //轮播图组件
    var Swiper={
        template:`<div class="swiper"></div>`
    }

    //推荐列表组件
    var List={
        template:`<div class="list">
    <div class="goods"></div>
    <div class="goods"></div>
    <div class="goods"></div>
    <div class="goods"></div>
</div>`
    }

    //底部
    var Tabber={
        template:`<div class="tabbar">
            <div class="btn">首页</div>
            <div class="btn">订单</div>
            <div class="btn">我的</div>
        </div>`
    }
    var v=new Vue({
        el:'#app',
        data:{

        },
        components:{
            'aa':inputBox,
            'bb':Swiper,
            'cc':List,
            'ee':Tabber
        }
    })
</script>
</html>